package de.uni_saarland.coli.doclists.data.btree.manager;

import de.uni_saarland.coli.doclists.data.btree.INode;
import de.uni_saarland.coli.doclists.data.btree.SplitData;
import de.uni_saarland.coli.doclists.index.IDiscIO;

/**
 * 
 * @author stefan
 * 
 *         Interface for managing nodes. Currently not used.
 * 
 * 
 * @param <T>
 *            The type of data.
 */
public interface IBTreeNodeManager<T> extends IDiscIO {
	/**
	 * Returns the node given an ID.
	 * 
	 * @param id
	 *            the node ID.
	 * @return the node.
	 */
	INode<T> getNode(int id);

	/**
	 * Returns the value given an ID
	 * 
	 * @param id
	 *            the values ID.
	 * @return the value
	 */
	T getValue(int id);

	/**
	 * Adds a new value
	 * 
	 * @param value
	 *            the value
	 * @return the values id
	 */
	int addValue(T value);

	/**
	 * Creates a new empty non bucket node.
	 * 
	 * @return the node
	 */
	INode<T> createNonBucketNode();

	/**
	 * Creates a new non bucket node from the split data
	 * 
	 * @param data
	 *            split data
	 * @return the node
	 */
	INode<T> createNonBucketNode(SplitData<T> data);

	/**
	 * Creates a new empty bucket node.
	 * 
	 * @return the node
	 */
	INode<T> createBucketNode();
}
